{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "2a25c5b8",
   "metadata": {},
   "outputs": [],
   "source": [
    "from westat import *\n",
    "\n",
    "# 导入 UCI_Credit_Card\n",
    "data = credit_card()\n",
    "\n",
    "# 将目标变量重命名为“y”\n",
    "data.rename(columns={'target':'y'},inplace=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "92e9f950",
   "metadata": {},
   "source": [
    "## 数据分区"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "bd2dfdc5",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# 使用 data_split 函数进行数据分区，或者使用别名函数 get_data_partition，按随机测试集25%进行数据分区\n",
    "data_train,data_test = data_split(data,0.25)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
